package com.qf.smartdevice.event;

import org.springframework.stereotype.Component;


/*
 * 这个是通知设备发生状态变化 比如上线或者下线
 * 哪个设备  上线还是下线了？
 * */

@Component
public class DevicesCacheChangeEvent {

    private String deviceuuid;//那个设备
    private String status;//变化的状态


    /*
     * 上线
     * */
    public static DevicesCacheChangeEvent onLine(String deviceuuid) {
        DevicesCacheChangeEvent event = new DevicesCacheChangeEvent();
        event.deviceuuid = deviceuuid;
        event.status = "1";
        return event;
    }

    /*
     * 离线
     * */
    public static DevicesCacheChangeEvent offLine(String deviceuuid) {
        DevicesCacheChangeEvent event = new DevicesCacheChangeEvent();
        event.deviceuuid = deviceuuid;
        event.status = "0";
        return event;
    }

    public String getDeviceuuid() {
        return deviceuuid;
    }

    public String getStatus() {
        return status;
    }
}
